﻿<script language="vbscript" runat="server">
dim allow_upload_image_ext as String,allow_upload_file_ext as String,word_image_file_ext as String
dim remotefile_maxfilesize as long,auto_remove_filesfolder as String,MTupload_maxfilesize as long

Function LoadXML2Obj(XMLPath) As Object
	dim xmlT
	xmlT=new System.Xml.XmlDocument()
	xmlT.Load(XMLPath)
	'If xmlT.parseError.errorCode <> 0 Then
	'	Response.write("load xml file error")
	'	response.end
	'End If

	return xmlT.documentElement
	xmlT = Nothing
End Function

Sub config_Main()
	dim root,configServer,configPublic
	root=LoadXML2Obj(Server.Mappath("../config.xml"))
	
	configServer=root.selectSingleNode("server")
	MTupload_maxfilesize=CLng(configServer.selectSingleNode("MTupload_maxfilesize").firstChild.innerText)
	configServer=nothing
	
	configPublic=root.selectSingleNode("public")
	allow_upload_image_ext=configPublic.selectSingleNode("allow_upload_image_ext").firstChild.innerText
	allow_upload_file_ext=configPublic.selectSingleNode("allow_upload_file_ext").firstChild.innerText
	word_image_file_ext=configPublic.selectSingleNode("word_image_file_ext").firstChild.innerText
	remotefile_maxfilesize=CLng(configPublic.selectSingleNode("remotefile_maxfilesize").firstChild.innerText)
	auto_remove_filesfolder=CBool(configPublic.selectSingleNode("auto_remove_filesfolder").firstChild.innerText)	
	configPublic=nothing
	root=nothing
End Sub

</script>
<%
call config_Main
%>